-- GENERATED SPELL FOR [Scholomance Dark Summoner] --


function spell0_11582(pUnit, Event) --@Curse of Blood,n/a--
pUnit:FullCastSpellOnTarget(12279,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_11582', 2000, 1)
end

function spell1_11582(pUnit, Event) --@Drain Life,Drain--
pUnit:FullCastSpellOnTarget(17620,pUnit:GetRandomPlayer(0))
pUnit:RegisterEvent('Sorts_11582', 5000, 1)
end

function spell2_11582(pUnit, Event) --@Summon Risen Lackey,n/a--
pUnit:FullCastSpellOnTarget(17618,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_11582', 2000, 1)
end

function Sorts_11582(pUnit, Event)
local choix_sorts_11582 = math.random(0, 2)
if choix_sorts_11582 == 0 then
pUnit:RegisterEvent('spell0_11582', 1, 1)
end
if choix_sorts_11582 == 1 then
pUnit:RegisterEvent('spell1_11582', 1, 1)
end
if choix_sorts_11582 == 2 then
pUnit:RegisterEvent('spell2_11582', 1, 1)
end
end

function mob11582_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_11582', math.random(1500, 3000), 1)
end

function mob11582_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob11582_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob11582_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(11582, 1, 'mob11582_Action')
RegisterUnitEvent(11582, 2, 'mob11582_Leave')
RegisterUnitEvent(11582, 3, 'mob11582_Kill')
RegisterUnitEvent(11582, 4, 'mob11582_Die')
